require 'unrealdb'

conn = UnrealDB::Connection.new('10.10.13.155')
puts "Erro ao conectar" if !conn.connect
cur = conn.get_cursor

real_start = Time.now
times = []

500.times do |i|
  foto_name = "foto" + i.to_s
  start = Time.now
  if !cur.get_document(foto_name)
    puts "Erro ao buscar arquivo : " + foto_name
  end
  times << (Time.now - start)
end

puts "Total: " + (Time.now - real_start).to_s
times.each{|t| puts t.to_s }

conn.close
